package cn.net.wangyixinwen.mvvm.adapter;

import android.widget.ImageView;

import androidx.annotation.NonNull;

import com.bumptech.glide.Glide;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;

import cn.net.wangyixinwen.R;
import cn.net.wangyixinwen.bean.NewsBean;

public class JXAdapter extends BaseQuickAdapter<NewsBean, BaseViewHolder> {
    public JXAdapter() {
        super(R.layout.item_jx);
    }

    @Override
    protected void convert(@NonNull BaseViewHolder baseViewHolder, NewsBean item) {
        baseViewHolder.setText(R.id.tv_title, item.getTitle());
        baseViewHolder.setText(R.id.tv_time, item.getPtime());
        baseViewHolder.setText(R.id.tv_ltitle, item.getLtitle());
        Glide.with(baseViewHolder.itemView)
                .load(item.getImgsrc().replace(",", ":"))
                .into((ImageView) baseViewHolder.getView(R.id.iv_image));
    }
}
